home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form fchart
- BackColor = &H00C0C0C0&
- Caption = "Charting"
- ClientHeight = 5670
- ClientLeft = 1095
- ClientTop = 1020
- ClientWidth = 8190
- Height = 6075
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 5670
- ScaleWidth = 8190
- Top = 675
- Width = 8310
- Begin ComboBox Combo1
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 315
- Left = 1320
- Style = 2 'Dropdown List
- TabIndex = 3
- Top = 285
- Width = 1605
- End
- Begin CommandButton Command2
- BackColor = &H00C0C0C0&
- Caption = "Zoom-"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Index = 1
- Left = 6765
- TabIndex = 2
- Top = 135
- Width = 1200
- End
- Begin CommandButton Command2
- BackColor = &H00C0C0C0&
- Caption = "Zoom+"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Index = 0
- Left = 5535
- TabIndex = 1
- Top = 135
- Width = 1200
- End
- Begin CommandButton Command1
- BackColor = &H00C0C0C0&
- Caption = "Print"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 4320
- TabIndex = 0
- Top = 135
- Width = 1200
- End
- Begin vsViewPort vsViewPort1
- BackColor = &H00C0C0C0&
- ConvInfo = FCHART.FRX:0000
- Height = 4650
- Left = 255
- Top = 690
- VirtualHeight = 0
- VirtualWidth = 0
- Width = 7305
- Begin vsPrinter vsPrinter1
- BrushColor = &H00C0C0C0&
- ConvInfo = FCHART.FRX:000B
- FontName = "Times New Roman"
- FontSize = 11
- HdrFontBold = -1 'True
- HdrFontName = "Courier New"
- HdrFontSize = 14
- Height = 2535
- Left = 285
- PageBorder = 0 'None
- TableSep = "|;"
- Top = 225
- Width = 1530
- End
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Borders"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 270
- Left = 540
- TabIndex = 4
- Top = 330
- Width = 750
- End
- Begin Image Image1
- Height = 555
- Index = 1
- Left = 3315
- Picture = FCHART.FRX:0016
- Stretch = -1 'True
- Top = 135
- Visible = 0 'False
- Width = 1020
- End
- Begin Image Image1
- Height = 600
- Index = 0
- Left = 3030
- Picture = FCHART.FRX:625E
- Stretch = -1 'True
- Top = 30
- Visible = 0 'False
- Width = 780
- End
- Option Explicit
- Dim strArr(7, 3) As String
- Dim zoom%
- Dim xd, yd
- Function BoxText (row%, col%) As String
- If strArr(row, col) = "" Then
- BoxText = "VideoSoft" & Chr(13) & "VSView Controls"
- Else
- BoxText = strArr(row, col)
- End If
- End Function
- Function BoxX (row%, col%, w!) As Single
- BoxX = vsPrinter1.MarginLeft + 500 + col * w * 1.2
- End Function
- Function BoxY (row%, col%, h!) As Single
- Dim y!
- y = 1 / (2 ^ col) * (row + .5) * 8 * h * 1.2
- BoxY = vsPrinter1.MarginTop + y
- End Function
- Sub Combo1_Click ()
- DoChart
- End Sub
- Sub Command1_Click ()
- vsPrinter1.Preview = False
- DoChart
- vsPrinter1.Preview = True
- End Sub
- Sub Command2_Click (Index As Integer)
- If Index = 0 Then
- zoom = zoom + 20
- Else
- zoom = zoom - 20
- End If
- If zoom < 20 Then zoom = 20
- If zoom > 120 Then zoom = 120
- SetZoom zoom
- End Sub
- Sub DoChart ()
- vsPrinter1.Action = 3
- DoDrawBorders
- vsPrinter1.FontSize = 36
- vsPrinter1 = "VideoSoft Flowchart"
- vsPrinter1.FontSize = 11
- DoDrawBoxes
- vsPrinter1.Action = 6
- End Sub
- Sub DoDrawBorders ()
- vsPrinter1.X1 = 0
- vsPrinter1.Y1 = 0
- vsPrinter1.X2 = vsPrinter1.PageWidth
- vsPrinter1.Y2 = vsPrinter1.PageHeight
- vsPrinter1.Picture = image1(combo1.ListIndex).Picture
- End Sub
- Sub DoDrawBoxes ()
- Dim row%, col%
- Dim x!, y!, w!, h!, s$, sl$
- ' initialize
- w = 1800
- h = w / 2
- ' draw a bunch of boxes
- For col = 0 To 3
- For row = 0 To 2 ^ col - 1
-
- ' draw the box
- x = BoxX(row, col, w)
- y = BoxY(row, col, h)
- s = BoxText(row, col)
- TextBox x, y, w, h, s
- ' draw connecting lines
- If col < 3 Then
- vsPrinter1.X1 = x + w
- vsPrinter1.Y1 = y + h / 2
- vsPrinter1.X2 = x + w * 1.1
- vsPrinter1.Y2 = y + h / 2
- vsPrinter1.Draw = 1 ' line
- x = BoxX(row, col + 1, w)
- y = BoxY(2 * row, col + 1, h) + h / 2
- sl = Str(x) + Str(y) + Str(x - .1 * w) + Str(y)
- y = BoxY(2 * row + 1, col + 1, h) + h / 2
- sl = sl + Str(x - .1 * w) + Str(y) + Str(x) + Str(y)
- vsPrinter1.PolyLine = sl
- End If
- Next
- Next
- End Sub
- Sub Form_Load ()
- ' initialize
- vsPrinter1.Preview = True
- zoom = 50
- SetZoom zoom
- combo1.AddItem "Feet"
- combo1.AddItem "Checkers"
- combo1.ListIndex = 1
- ' do the drawing
- DoChart
- End Sub
- Sub SetZoom (ByVal z!)
- vsPrinter1.Width = vsPrinter1.PageWidth * z / 100
- vsPrinter1.Height = vsPrinter1.PageHeight * z / 100
- vsviewport1.VirtualWidth = vsPrinter1.Width + 2 * vsPrinter1.Left
- vsviewport1.VirtualHeight = vsPrinter1.Height + 2 * vsPrinter1.Top
- End Sub
- Sub TextBox (x!, y!, w!, h!, s$)
- Dim ml&, mr&
- ' draw the box
- vsPrinter1.X1 = x
- vsPrinter1.Y1 = y
- vsPrinter1.X2 = x + w
- vsPrinter1.Y2 = y + h
- vsPrinter1.Draw = 2 ' rectangle
- ' draw the text
- ml = vsPrinter1.MarginLeft
- mr = vsPrinter1.MarginRight
- vsPrinter1.MarginLeft = x + 25
- vsPrinter1.MarginRight = vsPrinter1.PageWidth - x - w - 25
- vsPrinter1.CurrentX = vsPrinter1.MarginLeft
- vsPrinter1.CurrentY = y + 25
- vsPrinter1 = s
- vsPrinter1.MarginLeft = ml
- vsPrinter1.MarginRight = mr
- End Sub
- Sub vsPrinter1_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
- xd = x
- yd = y
- End Sub
-